-
-
Notifications
You must be signed in to change notification settings - Fork 18.8k
ExtensionArray.Round method and tests #54582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@@ -1094,7 +1094,8 @@ def round(self, decimals: int = 0, *args, **kwargs) -> Self: | |||
DataFrame.round : Round values of a DataFrame. | |||
Series.round : Round values of a Series. | |||
""" | |||
return type(self)(pc.round(self._pa_array, ndigits=decimals)) | |||
result = pc.round(self._pa_array, ndigits=decimals) | |||
return type(self)(result.cast(self._pa_array.type)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this cast needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you answer here
this is ready for review again |
Let's do this! |
poke @jbrockmendel |
This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this. |
doc/source/whatsnew/v3.0.0.rst
Outdated
@@ -866,6 +866,7 @@ Sparse | |||
|
|||
ExtensionArray | |||
^^^^^^^^^^^^^^ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like accidental
Couple small comments, otherwise LGTM. Thanks for your patience. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This adds abstract round method in ExtensionOpsMixin to tell EA authors to implement round, and provides a round test.